Skip to content

feat(compute): flavor extra_specs, instance resize + image_name, interface/volume attach - #14

Merged
PF9-pushkar merged 3 commits into
mainfrom
feat/compute-followups
Jul 12, 2026
Merged

feat(compute): flavor extra_specs, instance resize + image_name, interface/volume attach#14
PF9-pushkar merged 3 commits into
mainfrom
feat/compute-followups

Conversation

@PF9-pushkar

Copy link
Copy Markdown
Collaborator

Part of #2 (Phase 1 follow-ups) — the compute batch.

Changes

  • pcd_compute_flavor extra_specs — settable key/value map, added/changed/removed in place (Create/List/Delete extra-spec calls). Also made the other flavor attributes (ram/vcpus/disk/swap/rx_tx_factor/is_public/ephemeral) RequiresReplace to match the resource's documented immutability, so Update is exclusively about extra_specs and non-extra-spec changes no longer silently drift.
  • pcd_compute_instance resize — a flavor change now triggers an in-place resize (Resize → wait VERIFY_RESIZEConfirmResize → wait ACTIVE, best-effort RevertResize on failure) instead of forcing a new resource.
  • pcd_compute_instance image_name — boot by image name (resolved via Glance), an alternative to image_id (exactly one required; image change stays ForceNew).
  • New pcd_compute_interface_attach — attach a port/network to a server (composite id instance_id/port_id, echo-only fixed_ip).
  • New pcd_compute_volume_attach — attach a Cinder volume to a server; the volume-status wait is best-effort and degrades gracefully when there's no block-storage backend.

Adversarial review fix included

flavor_id (now in-place-updatable) kept UseStateForUnknown, which pinned the stale id into the plan when a resize was driven by flavor_name → the applied new id mismatched the plan → "inconsistent result after apply" on every flavor_name-driven resize. Removed the plan modifier and made Update always set the resolved flavor_id.

Live-validation status

Code-complete; all static checks green. Flavor extra_specs is live-testable (flavors work on the lab); the resize/attach paths need a bootable instance (and Cinder for volume attach) — currently lab-blocked. Not yet run against the lab this session (credentials unavailable). Tracked in DECISIONS.md.

build / vet / gofmt / golangci-lint (0 issues) / tfplugindocs all clean.

…rface/volume attach

- pcd_compute_flavor: settable extra_specs (add/change/remove in place via
  Create/List/Delete extra-spec calls). Made the other flavor attributes
  (ram/vcpus/disk/swap/rx_tx_factor/is_public/ephemeral) RequiresReplace to match
  the resource's documented immutability, so Update is exclusively about
  extra_specs and non-extra-spec changes no longer silently drift.
- pcd_compute_instance: flavor changes now trigger an in-place resize (Resize ->
  wait VERIFY_RESIZE -> ConfirmResize -> wait ACTIVE, best-effort RevertResize on
  failure) instead of forcing a new resource; flavor_id/flavor_name are no longer
  ForceNew. Added image_name as an alternative to image_id, resolved via Glance
  (exactly one required; image change stays ForceNew).
- New pcd_compute_interface_attach: attach a network interface to a server by
  port_id or network_id (composite id instance_id/port_id, echo-only fixed_ip).
- New pcd_compute_volume_attach: attach a Cinder volume to a server; best-effort
  volume-status wait degrades gracefully when no block-storage backend is present.

Acceptance tests added/extended (flavor extra_specs in-place update, instance
resize + image_name, interface/volume attach). build/vet/gofmt/golangci-lint (0
issues) and tfplugindocs all clean.
Dropping RequiresReplace from flavor_id (to allow resize) left it with
UseStateForUnknown, which pinned the stale flavor_id into the plan when a resize
was driven by flavor_name — the applied new id then mismatched the plan and
Terraform aborted with 'inconsistent result after apply'. Remove the plan
modifier so flavor_id goes unknown on change, and always set the resolved
flavor_id in Update (not only inside the resize branch). Found by adversarial
review.
@PF9-pushkar
PF9-pushkar merged commit fc33893 into main Jul 12, 2026
4 checks passed
@PF9-pushkar
PF9-pushkar deleted the feat/compute-followups branch July 12, 2026 03:59
PF9-pushkar added a commit that referenced this pull request Jul 14, 2026
feat(compute): flavor extra_specs, instance resize + image_name, interface/volume attach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant